import requests
import json

url = "http://localhost:3000/v1/chat/completions"
headers = {"Content-Type": "application/json",
           "Authorization": "Bearer sk-tDUJv2wdPoEyD3xB58F74cB4Ba354aF6Be3a9e47Fb8b1aB3"
           }

# 1、测试全局搜索  graphrag-global-search:latest
global_data = {
    "model": "qwen1.5-72b-chat",
    "messages": [{"role": "user", "content": "hello?"}]
    # "stream": True,#True or False
}
 

# 接收非流式输出
# 1、测试全局搜索  graphrag-global-search:latest
response = requests.post(url, headers=headers, data=json.dumps(global_data))

# 2、测试本地搜索  graphrag-local-search:latest
# response = requests.post(url, headers=headers, data=json.dumps(local_data))
# 3、测试全局和本地搜索  full-model:latest
# response = requests.post(url, headers=headers, data=json.dumps(full_data))

# print(response.json())
print(response.content)


 